load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")
load("@fbsource//tools/build_defs:rust_unittest.bzl", "rust_unittest")

oncall("scm_server_infra")

rust_library(
    name = "mercurial_derivation",
    srcs = glob(["src/**/*.rs"]),
    test_deps = [
        "//common/rust/shed/facet:facet",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/repo_attributes/bookmarks:bookmarks",
        "//eden/mononoke/repo_attributes/commit_graph/commit_graph:commit_graph",
        "//eden/mononoke/repo_attributes/filestore:filestore",
        "//eden/mononoke/repo_attributes/repo_blobstore:repo_blobstore",
        "//eden/mononoke/repo_attributes/repo_identity:repo_identity",
        "//eden/mononoke/repo_factory:test_repo_factory",
        "//eden/mononoke/tests/fixtures:fixtures",
        "//eden/mononoke/tests/utils:tests_utils",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:bytes",
        "fbsource//third-party/rust:either",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:tracing",
        "//common/rust/shed/borrowed:borrowed",
        "//common/rust/shed/bounded_traversal:bounded_traversal",
        "//common/rust/shed/cloned:cloned",
        "//common/rust/shed/justknobs_stub:justknobs",
        "//common/rust/shed/sorted_vector_map:sorted_vector_map",
        "//common/rust/shed/stats:stats",
        "//eden/mononoke/blobrepo:blobrepo_common",
        "//eden/mononoke/blobrepo:blobrepo_errors",
        "//eden/mononoke/blobstore:blobstore",
        "//eden/mononoke/derived_data:derived_data",
        "//eden/mononoke/derived_data:derived_data_manager",
        "//eden/mononoke/derived_data/remote/if:derived_data_service_if-rust",
        "//eden/mononoke/manifest:manifest",
        "//eden/mononoke/mercurial:mercurial_types",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/repo_attributes/bonsai_hg_mapping:bonsai_hg_mapping",
        "//eden/mononoke/repo_attributes/filestore:filestore",
        "//eden/mononoke/repo_attributes/repo_derived_data:repo_derived_data",
        "//eden/mononoke/repo_attributes/restricted_paths:restricted_paths",
        "//eden/mononoke/server/context:context",
    ],
)

rust_unittest(
    name = "mercurial_derivation_test",
    srcs = glob(["test/**/*.rs"]),
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:ascii",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:bytes",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:rand",
        "fbsource//third-party/rust:rand_distr",
        "fbsource//third-party/rust:rand_xorshift",
        "fbsource//third-party/rust:tokio",
        "//common/rust/shed/cloned:cloned",
        "//common/rust/shed/facet:facet",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//common/rust/shed/sql:sql",
        "//eden/mononoke/blobrepo:blobrepo_hg",
        "//eden/mononoke/blobstore:blobstore",
        "//eden/mononoke/blobstore:cacheblob",
        "//eden/mononoke/blobstore:delayblob",
        "//eden/mononoke/blobstore:memblob",
        "//eden/mononoke/cmdlib/caching:cmdlib_caching",
        "//eden/mononoke/common/scuba_ext:scuba_ext",
        "//eden/mononoke/derived_data/filenodes_derivation:filenodes_derivation",
        "//eden/mononoke/derived_data/mercurial_derivation:mercurial_derivation",
        "//eden/mononoke/features/changesets_creation:changesets_creation",
        "//eden/mononoke/manifest:manifest",
        "//eden/mononoke/mercurial:mercurial_types",
        "//eden/mononoke/mercurial:mercurial_types-mocks",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/repo_attributes/bonsai_hg_mapping:bonsai_hg_mapping",
        "//eden/mononoke/repo_attributes/bookmarks:bookmarks",
        "//eden/mononoke/repo_attributes/commit_graph/commit_graph:commit_graph",
        "//eden/mononoke/repo_attributes/filenodes:filenodes",
        "//eden/mononoke/repo_attributes/filestore:filestore",
        "//eden/mononoke/repo_attributes/repo_blobstore:repo_blobstore",
        "//eden/mononoke/repo_attributes/repo_derived_data:repo_derived_data",
        "//eden/mononoke/repo_attributes/repo_identity:repo_identity",
        "//eden/mononoke/repo_attributes/restricted_paths:restricted_paths",
        "//eden/mononoke/repo_factory:test_repo_factory",
        "//eden/mononoke/server/context:context",
        "//eden/mononoke/tests/fixtures:fixtures",
        "//eden/mononoke/tests/utils:tests_utils",
    ],
)
